﻿using System;
using System.IO;
using ProjScan.Tools;

namespace ProjScan.ScanRule
{
	// Token: 0x020001A3 RID: 419
	internal abstract class GlobalRule : BaseRule
	{
		// Token: 0x06000E26 RID: 3622 RVA: 0x00009C40 File Offset: 0x00007E40
		public virtual bool HasFailedInfo()
		{
			return false;
		}

		// Token: 0x06000E27 RID: 3623 RVA: 0x0001A928 File Offset: 0x00018B28
		public virtual string GetFailedInfo()
		{
			return string.Empty;
		}

		// Token: 0x06000E28 RID: 3624 RVA: 0x000403A4 File Offset: 0x0003E5A4
		public override bool CheckSupportability(out string msg)
		{
			msg = "";
			return true;
		}

		// Token: 0x06000E29 RID: 3625 RVA: 0x000403C0 File Offset: 0x0003E5C0
		public override void OutputData(bool append = false)
		{
			FileMode mode = append ? FileMode.Append : FileMode.Create;
			using (FileStream fileStream = File.Open(this.OutputPath, mode))
			{
				using (StreamWriter streamWriter = new StreamWriter(fileStream))
				{
					bool flag = !append;
					if (flag)
					{
						string value = "\"Location\",\"ShouldBeFixed\",\"ShouldJoinWhiteList\",\"IsFixed\"";
						streamWriter.WriteLine(value);
					}
					bool flag3;
					if (this.result != null)
					{
						object obj = this.result;
						if (obj is bool)
						{
							bool flag2 = (bool)obj;
							flag3 = !flag2;
							goto IL_63;
						}
					}
					flag3 = false;
					IL_63:
					bool flag4 = flag3;
					if (flag4)
					{
						string arg = string.Empty;
						bool flag5 = this.HasFailedInfo();
						if (flag5)
						{
							arg = this.GetFailedInfo();
						}
						streamWriter.WriteLine("\"{0}\",true,false,false", arg);
					}
				}
			}
		}

		// Token: 0x06000E2A RID: 3626 RVA: 0x0004049C File Offset: 0x0003E69C
		public override void OutputDetailData()
		{
			bool flag2;
			if (this.result != null)
			{
				object obj = this.result;
				if (obj is bool)
				{
					bool flag = (bool)obj;
					flag2 = !flag;
					goto IL_26;
				}
			}
			flag2 = false;
			IL_26:
			bool flag3 = flag2;
			if (flag3)
			{
				using (File.Open(this.DetailOutputPath, FileMode.Create))
				{
				}
			}
		}

		// Token: 0x06000E2B RID: 3627 RVA: 0x00040504 File Offset: 0x0003E704
		public override void DumpToRuleCSV(ref StreamWriter sw)
		{
			string[] values = new string[]
			{
				base.GetType().FullName.Replace("ProjScan.ScanRule.", ""),
				",",
				this.SceneId.ToString(),
				",",
				(this.result == null) ? null : this.result.ToString(),
				",",
				this.TableTag,
				","
			};
			string value = string.Concat(values);
			sw.WriteLine(value);
		}

		// Token: 0x06000E2C RID: 3628 RVA: 0x00002A20 File Offset: 0x00000C20
		public override void DumpToThresCSV(ref StreamWriter sw)
		{
		}

		// Token: 0x06000E2D RID: 3629
		public abstract void Run();

		// Token: 0x040008D1 RID: 2257
		protected object result = null;

		// Token: 0x040008D2 RID: 2258
		public FailedAssetInfo failedAssetInfo;
	}
}
